char* ampm = NULL;
int ac;
- ampm = (char*) xmalloc(strlen(s));
+ ampm = (char*) xmalloc(strlen(s) + 1);
ac = sscanf(s, format, &hour, &min, &sec, &m);
/* If no time format in arg string, assume AM */
if (ac < 4) {
len += 4; /* DWORD(0) after last ifd */
- if ((tag = exif_find_tag(app, IFD1, IFD1_TAG_JPEG_OFFS))) {
+ if ((exif_find_tag(app, IFD1, IFD1_TAG_JPEG_OFFS))) {
exif_put_long(IFD1, IFD1_TAG_JPEG_OFFS, 0, len);
}
DBG((sobj, "read next waypoint\n"));
tmp = mmo_read_object();
- if (tmp && tmp->data && (tmp->type = wptdata)) {
+ if (tmp && tmp->data && (tmp->type == wptdata)) {
Waypoint* wpt;
/* FIXME: At this point this waypoint maybe not fully loaded (initialized) !!!
double utm_easting = 0;
double utm_northing = 0;
char utm_zc = 'N';
+ // Zones are always two bytes. Spare one for null termination..
char bng_zone[3] = "";
double bng_easting = 0;
double bng_northing = 0;
break;
case fld_bng_zone:
- strncpy(bng_zone, s, sizeof(bng_zone));
+ strncpy(bng_zone, s, sizeof(bng_zone) -1 );
strupper(bng_zone);
break;